package homework1;

public class StockInfo {
	String ID = ""; 
	String TITLE = "";
	String AUTHOR = "";
	String DATE = "";
	String LASTUPDATE = "";
	String CONTENT = "";
	String ANSWERAUTHOR = "";
	String ANSWER = "";
	public StockInfo() {}
	public StockInfo(String str) {
		String[] strArray = str.split("\\s+");  
		for (int i = 0; i < strArray.length; i++) {  
		    switch (i) {  
		    case 0:  
		        ID = strArray[i]; 
		        break;  
		    case 1:  
		        TITLE = strArray[i];  
		        break;  
		    case 2:  
		        AUTHOR = strArray[i];   		  
		        break; 
		    case 3:  
		    	DATE = strArray[i];  
		        break;  
		    case 4:  
		    	LASTUPDATE = strArray[i];  
		        break;  
		    case 5:  
		    	CONTENT = strArray[i];  
		        break;  
		    case 6:  
		    	ANSWERAUTHOR = strArray[i];  
		        break;
		    case 7:  
		    	ANSWER = strArray[i];  
		        break;  
		  
		    default:  
		        break;  
		    }  
		}  
	}
	int getAnswerLength() {
		int Length= 0;
		Length = ANSWER.length();
		return Length;		
	}

}
